package crazy.extend;

public class SubClass extends BaseClass
{
	public String book = "j2ee";
	
	public void test()
	{
		System.out.println("subclass test");
	}
	
	public void sub()
	{
		System.out.println("sub normal");
	}
	
	public static void main(String[] args)
	{
		BaseClass bc = new BaseClass();
		System.out.println(bc.book); //6
		bc.base(); //mormal
		bc.test();// base' test
		
		SubClass sc = new SubClass();
		System.out.println(sc.book); //j2ee
		sc.base();//mormal
		sc.test();//sub test
		
		BaseClass polymorphiicBc = new SubClass();
		System.out.println(polymorphiicBc.book); //6
		polymorphiicBc.base(); //mormal
		polymorphiicBc.test();// sub test
		
	}
}
